package app.auto.runner.base.utility;

import android.view.View;

/**
 * Created by hp on 2018/2/10.
 */

public abstract class ToogleClicker implements View.OnClickListener {
    boolean pressed;

    @Override
    public void onClick(View view) {
        if (pressed) {
            untoogle(view);
            showOpenText(view);
        } else {
            toogle(view);
            showCloseText(view);
        }
        pressed = !pressed;
    }

    protected abstract void showOpenText(View view);

    protected abstract void showCloseText(View view);


    public abstract void untoogle(View view);
    public abstract void toogle(View view);


}
